<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form onsubmit="return false">
    <input type="text" name="bankCode">
    <input type="password" name="password">
    <input type="submit" value="登录">

</form >
<script type="text/javascript" src="js/jquery-1.8.3.min.js">
</script>
<script>
    $("form").submit(function () {
        $.ajax({
            type:"post",
            url:"login.do",
            data:$("form").serialize(),
            dataType:"json",
            success:function (data) {
                //data 就是后端 返回的数据 {"code":1,"info":null}
                if(data.code==1){
                    window.location.href="index.html"
                }else (
                    alert(data.info)
                )
            }
        })
    })
</script>
</body>
</html>